package edu.pku.sei.act.actools.util.policy;

import java.util.ArrayList;


public abstract class OBPolicy {
	protected boolean enable;
	protected ObjectAdapter subject;
	public TaskEvent triggerEvent;
	protected String policyID;
	public String preCondition;
	public String postCondition;
	protected ArrayList<Constraint> constraintList = new ArrayList<Constraint>();
	public abstract void doAction();
	private boolean checkConstraints(TaskEvent eo) {
		for (int i = 0; i < constraintList.size(); i++) {
			if (constraintList.get(i).check(subject, eo)) {
				return false;
			}
		}
		return true;
	}
	public void fire() {
		
	}
	public void enable() {
		enable = true;
	}
	public void disable() {
		enable = false;
	}
}
